package com.example.hp.ormapp.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatTextView;

import com.allen.library.SuperTextView;
import com.example.hp.ormapp.base.BaseBackActivity;
import com.example.hp.ormapp.bean.CrmBean;
import com.gyf.barlibrary.ImmersionBar;
import com.rongsheng.ormapp.R;

/**
 * Created by hang on 2018/4/26 0026.
 */

public class CrmDetailActivity extends BaseBackActivity {

    private SuperTextView mCrmFront;
    private SuperTextView mCrmSeries;
    private SuperTextView mCrmHeight;
    private SuperTextView mCrmWidth;
    private SuperTextView mCrmLength;
    private SuperTextView mCrmDosage;
    private SuperTextView mCrmProcessingFee;
    private SuperTextView mCrmCreation;
    private AppCompatTextView mCrmRemark;

    @Override
    public int getLayoutId() {
        return R.layout.activity_crmdetail;
    }

    @Override
    public void initView(@Nullable Bundle savedInstanceState) {

        mCrmFront = findViewById(R.id.crm_front);
        mCrmSeries = findViewById(R.id.crm_series);
        mCrmHeight = findViewById(R.id.crm_height);
        mCrmWidth = findViewById(R.id.crm_width);
        mCrmLength = findViewById(R.id.crm_length);
        mCrmDosage = findViewById(R.id.crm_dosage);
        mCrmProcessingFee = findViewById(R.id.crm_processingFee);
        mCrmCreation = findViewById(R.id.crm_creation);
        mCrmRemark = findViewById(R.id.crm_remark);
    }

    @Override
    public void initData() {
        CrmBean.RowsBean crmValue = getIntent().getParcelableExtra("crmValue");
        setTitle(crmValue.getFront());
        mCrmFront.setRightString(crmValue.getFront());
        mCrmSeries.setRightString(crmValue.getSeries());
        mCrmHeight.setRightString(crmValue.getHeight() + "");
        mCrmWidth.setRightString(crmValue.getWidth() + "");
        mCrmLength.setRightString(crmValue.getLength() + "");
        mCrmDosage.setRightString(crmValue.getDosage() + "");
        mCrmProcessingFee.setRightString(crmValue.getProcessingFee() + "");
        mCrmCreation.setRightString(crmValue.getCreationTime());
        mCrmRemark.setText(crmValue.getRemark());
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this).statusBarColor(R.color.title).init();
    }

}
